package com.alibaba.citrus.ots.b2b.trade.order.functions.deliveryOrder.entity;

import com.alibaba.citrus.ots.b2b.trade.order.repository.DeliverOrderWriteRepository;
import com.alibaba.citrus.ots.common.util.SpringContextUtil;
import com.epoch.app.otsb2btradecenter.sdo.DeliverOrderSDO;
import lombok.Getter;

@Getter
public class DeliveryOrderWriteEntity {

    private DeliverOrderSDO deliverOrderSDO;

    private static DeliverOrderWriteRepository deliverOrderWriteRepository;

    static {
        deliverOrderWriteRepository = SpringContextUtil.getBean(DeliverOrderWriteRepository.class);
    }

    public static DeliveryOrderWriteEntity of(DeliverOrderSDO deliverOrderSDO) {
        DeliveryOrderWriteEntity deliverOrderWriteEntity = new DeliveryOrderWriteEntity();
        deliverOrderWriteEntity.deliverOrderSDO = deliverOrderSDO;
        return deliverOrderWriteEntity;
    }

    /**
     * 修改交互单状态
     */
    public Boolean modify() {
        return deliverOrderWriteRepository.modify(this.deliverOrderSDO);
    }
}
